package run

import (
	"flag"
	"fmt"
	"gin-extend-demo/jobs"

	"gitee.com/fkil555/gin-extend/cron"
)

func NewCron() {
	flag.Parse()
	if c, err := cron.New(); err == nil {
		c.AddJob("test", "* * * * *", c.WithGEContext(jobs.Update))
		c.Run()
	} else {
		fmt.Println(err)
	}
}
